<?php
/**
 * Dragons Fun copy
 * @author aanbek
 */
$title = 'Драконы';
include_once 'inc/fnc.php';
 if (isset($_POST['login']) && isset($_POST['password'])) {
        $nameAuth = trim(htmlspecialchars($_POST['login']));
        $passwordAuth = trim(htmlspecialchars($_POST['password']));
               $sqlAuth = "SELECT * FROM `users` WHERE `login`=? and `password`=?";
        $plAuth = array($nameAuth, $passwordAuth);
        $rowsAuth = $db->rows($sqlAuth, $plAuth);
        if ($rowsAuth == 1) {
            $AuthClient = $db->fetch($sqlAuth, $plAuth);
            $_SESSION['id'] = $AuthClient['id'];
            $_SESSION['password'] = $passwordAuth;
            header("Location:/");
        } else {
            ?>
          <div class="cntr">




<div class="plate_err mtb5 mlr10">
<div class="plate_err_b">
<div class="plate_err_l">
<div class="plate_err_r">
<div class="plate_err_rt">
<div class="plate_err_rb">
<div class="plate_err_lt">
<div class="plate_err_lb cntr">
Игрок не найден
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>








</div>
            <?
        }
    }
?>
<div class="main">
<div class="main_brd">
<div class="header">
<div class="header_in pt15 pb5">
<div class="page_title">
<div class="page_title_in">Вход для игроков</div>
</div>
</div>
</div>
<div class="cntr">







</div>
<div class="cntr m10">
<form id="id1" method="post" action="./login?"><div style="width:0px;height:0px;position:absolute;left:-100px;top:-100px;overflow:hidden"><input type="hidden" name="id1_hf_0" id="id1_hf_0"></div>
<label>Имя в игре:</label><br>
<input type="text" name="login" class="typetext" value=""><br>
<label>Пароль:</label><br>
<input type="password" name="password" class="typetext" value=""><br>
<span class="btn_g w120 mt5"><span class="btn_g_in"><input type="submit" value="Войти"></span></span>
</form>
<div class="hr mt10 mb10"></div>
<span class="minor">Вы не зарегистрированы?</span><br>
<a href="./start">Начни играть без регистрации</a><br>
<div class="hr mt10 mb10"></div>
<a href="./restore">Забыли пароль?</a>
<div class="hr mt10 mb10"></div>
<a href="/">Главная</a>
</div>

<?
include_once 'inc/foot.php';